package com.sskj.spk.presenter;

import com.lzy.okgo.model.Response;
import com.sskj.common.base.HttpData;
import com.sskj.lib.http.JsonCallBack;
import com.sskj.spk.bean.MainBannerBean;
import com.sskj.spk.http.HttpConfig;
import com.sskj.spk.ui.fragment.HangQingFragment;


public class HangQingFragmentPresenter extends BasePresenter<HangQingFragment> {
    public void getBannerUrl() {
        httpService.getBannerImage()
                .execute(new JsonCallBack<HttpData<MainBannerBean>>() {
                    @Override
                    public void onSuccess(Response<HttpData<MainBannerBean>> response) {
                        HttpData<MainBannerBean> httpData = response.body();
                        if (httpData.getStatus() == HttpConfig.OK) {
                            if (httpData.getData() != null) {
                                mView.showBanner(httpData.getData());
                            }
                        }
                    }
                });
    }
}
